package org.grayrabbit.cms.service.system.impl;

import java.util.HashMap;
import java.util.Map;

import org.grayrabbit.cms.entity.Admin;


public class AdminContext {
	private static Map<String,Admin> adminMap;
	
	static void put(Admin admin){
		synchronized (AdminContext.class) {
			if(adminMap==null)
				adminMap = new HashMap<String, Admin>();
			adminMap.put(admin.getLoginName(), admin);
		}
	}
	
	static Admin get(String loginName){
			if(adminMap==null){
				return null;
			}
			return adminMap.get(loginName);
	}
	static void remove(String loginName){
		synchronized (AdminContext.class) {
			if(adminMap==null)
				return;
			adminMap.remove(loginName);
		}
	}
}
